package com.gx.controller.sys;

import com.gx.dto.base.result.Results;
import com.gx.dto.base.result.SingleResult;
import com.gx.dto.command.SysUserAddCmd;
import com.gx.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 用户信息表 前端控制器
 *
 * @author liu-pj
 * @since 2024-03-26 10:53
 */
@RestController
@RequestMapping("/sys-user")
public class SysUserController {
    @Autowired
    private SysUserService sysUserService;

    @PostMapping("/save")
    public SingleResult<Integer> save(@RequestBody @Valid SysUserAddCmd userAddCmd) {
        Integer id = this.sysUserService.save(userAddCmd);
        return Results.buildResult(id);
    }

}
